<?php
/**
 * Copyright (C) 2010-2013 Oscar Valenzuela B. (ovalenzuela@xpertians.com)
 * 
 * This file is part of WarpIT.
 * WarpIT is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * WarpIT is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with WarpIT.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * This class cointains HSS translate methods for WarpIT
 * @author Oscar Valenzuela <ovalenzuela@xpertians.com>
 * @version 1.0
 * @package WarpIT!
 * @copyright Copyright (C) 2010-2013 Xpertians SpA
 * @license GNU GPLv3 or later
 * @link http://www.xpertians.com
 */
 
Class Translate_HSS{
	
	/**
	 * Array to return
	 *
	 * @var mixed
	 */
	private $res;
	
	/**
	 * Parse_HSS is the constructor of this class
	 *
	 */
	function Translate_HSS(){
		$this->res	= array();
	}
	
	/**
	 * Translate Array for Human reading
	 *
	 * Following syntax are recognized :
	 *
	 * @param string $array Original
	 * @return mixed
	 */
	function Translate($array){
		$res['HLR']			= "UDB";
		$res['MSISDN']			= $array['ISDN'];
		$res['IMSI']			= $array['IMSI'];
		$res['STATUS']			= "CONECTADO";
		$res['AUTH']			= "DISPONIBLE";
		if($array['NAM']=="BOTH"){
			$res['SERVICES']		= "VOZ DATOS";
		}elseif($array['NAM']=="MSC"){
			$res['SERVICES']		= "VOZ";
		}else{
			$res['SERVICES']		= "UNKNOW";
		}
		$res['VOICEREGS']		= $array['VLRNUM'];
		$res['MSC']			= $array['MSCNUM'];
		$res['DATAREGS']		= $array['SGSNNUM'];
		$res['COUNTRY']			= $array['COUNTRY'];
		$res['OPERATOR']		= $array['OPERATOR'];
		$res['CENTRAL']			= $array['CENTRAL'];
		$res['DATA4GREGS']		= $array['MMEHOST'];
		$res['SMSENABLED']		= 'INACTIVO';
		$res['SMSORIGIN']		= 'INACTIVO';
/*AGREGADO */   $res['OCSI_ID']                 = $array['OCSI_ID']; /*AGREGADO */









		foreach($array['BASIC_SERVICE']['TS'] AS $ts){
			if(strstr($ts, "Short Message MT_PP (TS21)")){
				$res['SMSENABLED']		= 'ACTIVO';
			}
			if(strstr($ts, "Short Message MO_PP (TS22)")){
				$res['SMSORIGIN']		= 'ACTIVO';
			}
		}
		
		if($array['ODBROAM']=="NOBAR"){
			$res['ROAM_TRAF_REST']		= 'INACTIVO';
		}else{
			$res['ROAM_TRAF_REST']		= 'ACTIVO';
		}
		
		
		if($array['BOIC']=="PROV"){
			$res['INTER_TRAF_REST']		= 'ACTIVO';
		}else{
			$res['INTER_TRAF_REST']		= 'INACTIVO';
		}
		
		$res['TRAFIC_ENABLE']		= "CONTRATO - HABILITADO";
		
		if($array['CFU']=="PROV"){
			if(trim($array['CFU_FTN'])!=""){
				$res['VOICEMAIL_ALL']		= 'ACTIVO '.$array['CFU_FTN'];
			}else{
				$res['VOICEMAIL_ALL']		= 'INACTIVO';
			}
		}else{
			$res['VOICEMAIL_ALL']		= 'NO DISPONE';
		}
		
		if($array['CFB']=="PROV"){
			if(trim($array['CFB_FTN'])!=""){
				$res['VOICEMAIL_BUSY']		= 'ACTIVO '.$array['CFB_FTN'];
			}else{
				$res['VOICEMAIL_BUSY']		= 'INACTIVO';
			}
		}else{
			$res['VOICEMAIL_BUSY']		= 'NO DISPONE';
		}

		if($array['CFNRY']=="PROV"){
			if(trim($array['CFNRY_FTN'])!=""){
				$res['VOICEMAIL_NOHANG']		= 'ACTIVO '.$array['CFNRY_FTN'];
			}else{
				$res['VOICEMAIL_NOHANG']		= 'INACTIVO';
			}
		}else{
			$res['VOICEMAIL_NOHANG']		= 'NO DISPONE';
		}

		if($array['CFNRC']=="PROV"){
			if(trim($array['CFNRC_FTN'])!=""){
				$res['VOICEMAIL_OUT']		= 'ACTIVO '.$array['CFNRC_FTN'];
			}else{
				$res['VOICEMAIL_OUT']		= 'INACTIVO';
			}
		}else{
			$res['VOICEMAIL_OUT']		= 'NO DISPONE';
		}
		
		if($res['ODBPB3']=="TRUE"){
			$res['SUSP_PAY_UNI']		= 'ACTIVO';
		}else{
			$res['SUSP_PAY_UNI']		= 'INACTIVO';
		}
		
		if($array['ODBIC']=="NOBIC"){
			$res['SUSP_LATE_BI']		= 'INACTIVO';
		}else{
			$res['SUSP_LATE_BI']		= 'ACTIVO';
		}
		
		if($array['ODBOC']=="NOBOC"){
			$res['SUSP_VOL']		= 'INACTIVO';
		}else{
			$res['SUSP_VOL']		= 'ACTIVO';
		}
		
		if($array['CWAIT']=="PROV"){
			$res['WAIT_CALL']		= 'INACTIVO';
		}else{
			$res['WAIT_CALL']		= 'ACTIVO';
		}
		
		if($array['BACKTONE']=="PROV"){
			$res['WAIT_MUSIC']		= 'ACTIVO';
		}else{
			$res['WAIT_MUSIC']		= 'INACTIVO';
		}
		
		if($array['CLIP']=="PROV"){
			$res['CALLER_ID']		= 'ACTIVO';
		}else{
			$res['CALLER_ID']		= 'INACTIVO';
		}
		
		if($array['CLIR']=="PROV"){
			$res['PRIVATED_ID']		= 'ACTIVO';
		}else{
			$res['PRIVATED_ID']		= 'INACTIVO';
		}
		
		$res['ABREVIATED_CALL']		= $this->Translate_ECATEGORY($array['ECATEGORY']); //COMPLETAR DESDE TABLA
		
		$i	= 0;
		foreach($array['GPRS_DATA']["APNTPLID"] AS $apn){
			$res['APN'][$i]['APN_ID']		= $apn[0].$apn[1].$apn[2].$apn[3];
			$res['APN'][$i]['APN_NAME']		= $this->Translate_APNID($apn[0].$apn[1].$apn[2].$apn[3]);
			$res['APN'][$i]['EQOSID']		= $this->Translate_QOSTPLID($array['GPRS_DATA']["QOSTPLID"][$i]);
			$res['APN'][$i]['EPSQOSID']		= $this->Translate_EPS_QOSTPLID($array['GPRS_DATA']["EPS_QOSTPLID"][$i]);
			$res['APN'][$i]['VPAA']			= "NO";
			$res['APN'][$i]['PDPTY']		= $array['GPRS_DATA']["PDPTYPE"][$i];
			$i++;
		}
		
		return $res;
	}
	
	/**
	 * Translate_ECATEGORY Array for Human reading
	 *
	 * Following syntax are recognized :
	 *
	 * @param string $array Original
	 * @return string
	 */
	function Translate_ECATEGORY($ecategory){
		switch($ecategory){
			case "NOTPROV":
				$response	= "NO CONTRATADO";
			break;
			case "":
				$response	= "DEFAULT";
			break;
			case "0":
				$response	= "DEFAULT";
			break;
			case "1":
				$response	= "188, Compania de Telefonos de Chile transmisiones regionales S.A.";
			break;
			case "2":
				$response	= "123, Empresa nacional de telecomunicaciones S.A.,  Entel chile S.A.";
			break;
			case "3":
				$response	= "120, Globus 120 S.A.";
			break;
			case "4":
				$response	= "171, TELMEX S.A. (ex Chilesat S.A)";
			break;
			case "5":
				$response	= "176, Net-Chile S.A.";
			break;
			case "6":
				$response	= "112, Convergia Chile S.A.";
			break;
			case "7":
				$response	= "111, VTR Global Carrier S.A.";
			break;
			case "8":
				$response	= "117, 117 Telecomunicaciones S.A.";
			break;
			case "9":
				$response	= "116, Heilsberg S.A.";
			break;
			case "10":
				$response	= "169, Netline Multicarrier S.A.";
			break;
			case "11":
				$response	= "115, 115 Telecomunicaciones S.A.";
			break;
			case "12":
				$response	= "150, Newwave Comunications S.A.";
			break;
			case "13":
				$response	= "121, Telefonica del sur carrier S.A.";
			break;
			case "14":
				$response	= "181, Bellsouth chile S.A.";
			break;
			case "15":
				$response	= "110, Telmex chile networks S.A.";
			break;
			case "16":
				$response	= "113, Transam comunicaciones S.A.";
			break;
			case "17":
				$response	= "114, E-newcarrier.com chile S.A.";
			break;
			case "18":
				$response	= "118, ifx larga distancia chile S.A.";
			break;
			case "19":
				$response	= "119, Concert Chile S.A.";
			break;
			case "20":
				$response	= "122, Manquehue telecomunicaciones de larga distancia S.A.";
			break;
			case "21":
				$response	= "124, GPS Chile Ltda";
			break;
			case "22":
				$response	= "125, Equant chile S.A.";
			break;
			case "23":
				$response	= "126, New world telecom S.A.";
			break;
			case "24":
				$response	= "127, Sur comunicaciones S.A.";
			break;
			case "25":
				$response	= "129, Telmex Chile Wireless S.A.";
			break;
			case "26":
				$response	= "151, Astro S.A";
			break;
			case "27":
				$response	= "152, Chile 189 S.A";
			break;
			case "28":
				$response	= "153, Stel Chile S.A.";
			break;
			case "29":
				$response	= "154, Micarrier telecomunicaciones S.A.";
			break;
			case "30":
				$response	= "155, Telmex chile long distance S.A.";
			break;
			case "31":
				$response	= "156, Imagen S.A.";
			break;
			case "32":
				$response	= "157, Conect S.A.";
			break;
			case "33":
				$response	= "158, Fibersat S.A.";
			break;
			case "34":
				$response	= "159, GTD Larga distancia S.A.";
			break;
			case "35":
				$response	= "161, Embratel chile S.A.";
			break;
			case "36":
				$response	= "170, Impsat chile S.A.";
			break;
			case "37":
				$response	= "172, Conexiión chile S.A.";
			break;
			case "38":
				$response	= "173, Telephone2 S.A.";
			break;
			case "39":
				$response	= "177, Empresa de transporte de señales S.A.";
			break;
			case "40":
				$response	= "178, Transfer telecomunicaciones S.A.";
			break;
			case "41":
				$response	= "179, Telecomunicaciones internacionales dialnet S.A.";
			break;
			default:
				$response	= $ecategory;
			break;
		}
		return $response;
	}
	
	/**
	 * Translate_APNID Array for Human reading
	 *
	 * Following syntax are recognized :
	 *
	 * @param string $array Original
	 * @return string
	 */
	function Translate_APNID($APNID){
		switch($APNID){
case"1":$response="WEB.TMOVIL.CL";break;
case"2":$response="WAP.TMOVIL.CL";break;
case"3":$response="MMS.TMOVIL.CL";break;
case"4":$response="TMC.TMOVIL.CL";break;
case"5":$response="OMCTC.TMOVIL.CL";break;
case"6":$response="INTRALOT.TMOVIL.CL";break;
case"7":$response="CAR.MOVISTAR.CL";break;
case"8":$response="GPS.TMOVIL.CL";break;
case"11":$response="TORRE.TMOVIL.CL";break;
case"12":$response="FSPTM.TMOVIL.CL";break;
case"13":$response="PIDDO.TMOVIL.CL";break;
case"14":$response="SARGENT.TMOVIL.CL";break;
case"15":$response="RGT.TMOVIL.CL";break;
case"17":$response="SODIMAC.TMOVIL.CL";break;
case"20":$response="TBK.TMOVIL.CL";break;
case"21":$response="BYTE.TMOVIL.CL";break;
case"24":$response="LEGRAND.TMOVIL.CL";break;
case"25":$response="BRAVOCAS.TMOVIL.CL";break;
case"26":$response="CANAL13.TMOVIL.CL";break;
case"27":$response="REDBANC.TMOVIL.CL";break;
case"29":$response="GASCO.TMOVIL.CL";break;
case"30":$response="BCN.TMOVIL.CL";break;
case"33":$response="TYCO.TMOVIL.CL";break;
case"34":$response="ALUSA.TMOVIL.CL";break;
case"36":$response="INTER.TMOVIL.CL";break;
case"37":$response="CTC2.TMOVIL.CL";break;
case"40":$response="PUNTOVISTA.TMOVIL.CL";break;
case"41":$response="METROGAS.TMOVIL.CL";break;
case"42":$response="RUTA.TMOVIL.CL";break;
case"43":$response="RIPLEY.TMOVIL.CL";break;
case"44":$response="HOST.TMOVIL.CL";break;
case"45":$response="RENDIC.MOVISTAR.CL";break;
case"47":$response="SALCO.TMOVIL.CL";break;
case"48":$response="BHP.TMOVIL.CL";break;
case"49":$response="SOCOVESA.MOVISTAR.CL";break;
case"50":$response="HOSTLAN.TMOVIL.CL";break;
case"52":$response="PROHENS.TMOVIL.CL";break;
case"53":$response="MINPU.MOVISTAR.CL";break;
case"54":$response="AXIOMA.TMOVIL.CL";break;
case"55":$response="PRESTO.TMOVIL.CL";break;
case"57":$response="SANTANDER.TMOVIL.CL";break;
case"58":$response="INP.TMOVIL.CL";break;
case"59":$response="INDAP.TMOVIL.CL";break;
case"60":$response="HABITAT.MOVISTAR.CL";break;
case"63":$response="INDAP.MOVISTAR.CL";break;
case"65":$response="PTT.MOVISTAR.CL";break;
case"66":$response="SQM.MOVISTAR.CL";break;
case"68":$response="CRISTALERIAS.MOVISTAR.CL";break;
case"69":$response="SALCOBRAND.MOVISTAR.CL";break;
case"70":$response="REDBANC.MOVISTAR.CL";break;
case"71":$response="COPESA.MOVISTAR.CL";break;
case"72":$response="CFRUTOS.MOVISTAR.CL";break;
case"73":$response="RIPLEYGPS.MOVISTAR.CL";break;
case"74":$response="METROWAM.MOVISTAR.CL";break;
case"75":$response="COSECHE.MOVISTAR.CL";break;
case"76":$response="ASITEC.MOVISTAR.CL";break;
case"99":$response="LBS.TMOVIL.CL";break;
case"101":$response="MUNISTGO.MOVISTAR.CL";break;
case"102":$response="KOPOLAR.MOVISTAR.CL";break;
case"103":$response="SONACOL.MOVISTAR.CL";break;
case"104":$response="BLACKBERRY.NET";break;
case"105":$response="BLACKBERRY2.CL";break;
case"106":$response="GTD.MOVISTAR.CL";break;
case"106":$response="GTD.MOVISTAR.CL";break;
case"107":$response="LOREAL.MOVISTAR.CL";break;
case"108":$response="MININTERIOR.MOVISTAR.CL";break;
case"109":$response="ONVISION.MOVISTAR.CL";break;
case"111":$response="MF.MOVISTAR.CL";break;
case"113":$response="CAMAN.MOVISTAR.CL";break;
case"114":$response="TECNET.MOVISTAR.CL";break;
case"115":$response="MME.MOVISTAR.CL";break;
case"116":$response="GTECH.MOVISTAR.CL";break;
case"117":$response="COPEC.MOVISTAR.CL";break;
case"119":$response="TBK.MOVISTAR.CL";break;
case"120":$response="BLACKBERRY.MOVISTAR.CL";break;
case"121":$response="INTERDATOS001.MOVISTAR.CL";break;
case"122":$response="BASF.MOVISTAR.CL";break;
case"123":$response="DOS.TMOVIL.CL";break;
case"124":$response="BCI.MOVISTAR.CL";break;
case"125":$response="FEDEX.MOVISTAR.COM";break;
case"126":$response="CGD.MOVISTAR.CL";break;
case"127":$response="PROMAIL.MOVISTAR.CL";break;
case"128":$response="TRIAL.TMOVIL.CL";break;
case"133":$response="DHL.MOVISTAR";break;
case"134":$response="M2M.MOVISTAR.CL";break;
case"135":$response="DAS.MOVISTAR.CL";break;
case"136":$response="NAT.MOVISTAR.CL";break;
case"138":$response="LBSGPS.MOVISTAR.CL";break;
case"139":$response="INTERTOTEM.MOVISTAR.CL";break;
case"140":$response="GILBARCO.MOVISTAR.CL";break;
case"141":$response="RIPLEYCOB.MOVISTAR.CL";break;
case"142":$response="CHILQUINTA.MOVISTAR.CL";break;
case"143":$response="EGT.MOVISTAR.CL";break;
case"145":$response="PCSCHILE.MOVISTAR.CL";break;
case"147":$response="CGEBIN.MOVISTAR.CL";break;
case"149":$response="INTERTIME.MOVISTAR.CL";break;
case"150":$response="ENAEX.MOVISTAR.CL";break;
case"151":$response="CERCHILE.MOVISTAR.CL";break;
case"152":$response="COPEC1.MOVISTAR.CL";break;
case"153":$response="YX.MOVISTAR.CL";break;
case"155":$response="SERVIPAG.MOVISTAR.CL";break;
case"156":$response="INTRALOT.MOVISTAR.CL";break;
case"157":$response="MINSAL.MOVISTAR.CL";break;
case"158":$response="CHXP.MOVISTAR.CL";break;
case"159":$response="EBEMA.MOVISTAR.CL";break;
case"160":$response="BCOESTADO.MOVISTAR.CL";break;
case"161":$response="SYNAPSIS.MOVISTAR.CL";break;
case"162":$response="SECAR2.MOVISTAR.CL";break;
case"163":$response="STREAM.MOVISTAR.CL";break;
case"164":$response="BECHCAJEROS.MOVISTAR.CL";break;
case"165":$response="SERVICAJAS.MOVISTAR.CL";break;
case"166":$response="MTCJ.MOVISTAR.CL";break;
case"167":$response="LANAIRLINES.MOVISTAR.CL";break;
case"168":$response="CVECINA.MOVISTAR.CL";break;
case"169":$response="PRODALAM.MOVISTAR.CL";break;
case"172":$response="LOTERIACONC.MOVISTAR.CL";break;
case"173":$response="PQMT.MOVISTAR.CL";break;
case"175":$response="NAVENTO.MOVISTAR.CL";break;
case"177":$response="DERCO.MOVISTAR.CL";break;
case"179":$response="POLINV.MOVISTAR.CL";break;
case"182":$response="EON.MOVISTAR.CL";break;
case"183":$response="EMBONOR.MOVISTAR.CL";break;
case"184":$response="INGENICO.MOVISTAR.CL";break;
case"185":$response="PUBLITIME.MOVISTAR.CL";break;
case"188":$response="HONEYWELL.MOVISTAR.CL";break;
case"189":$response="SONDA.MOVISTAR.CL";break;
case"190":$response="SAMTECH.MOVISTAR.CL";break;
case"191":$response="CODELCODANDSAS.MOVISTAR.CL";break;
case"192":$response="ORSAN.MOVISTAR.CL";break;
case"193":$response="ORYK.MOVISTAR.CL";break;
case"194":$response="SAESA.MOVISTAR.CL";break;
case"195":$response="ACCOR.MOVISTAR.CL";break;
case"196":$response="SENDA.MOVISTAR.CL";break;
case"197":$response="GTECH2.MOVISTAR.CL";break;
case"198":$response="INTFINBECH.MOVISTAR.CL";break;
case"199":$response="PGUIAS.MOVISTAR.CL";break;
case"200":$response="ECOFOR.MOVISTAR.CL";break;
case"201":$response="SCANIA.MOVISTAR.CL";break;
case"202":$response="MOVILMASTER.MOVISTAR.CL";break;
case"203":$response="CARRAN.MOVISTAR.CL";break;
case"204":$response="MULTICARD.MOVISTAR.CL";break;
case"205":$response="PROMIX.MOVISTAR.CL";break;
case"207":$response="MINEDUC.MOVISTAR.CL";break;
case"208":$response="SOLUTIONS.MOVISTAR.CL";break;
case"209":$response="BBVA.MOVISTAR.CL";break;
case"210":$response="HELP.MOVISTAR.CL";break;
case"211":$response="PREVIRED.MOVISTAR.CL";break;
case"212":$response="TBK-TEST.MOVISTAR.CL";break;
case"214":$response="SERCOTEC.MOVISTAR.CL";break;
case"215":$response="GMO.MOVISTAR.CL";break;
case"216":$response="TELEPIZZA.MOVISTAR.CL";break;
case"217":$response="SDVF.MOVISTAR.CL";break;
case"218":$response="G4S.MOVISTAR.CL";break;
case"219":$response="MUTUAL.MOVISTAR.CL";break;
case"220":$response="ADEXUS-SRCEI.MOVISTAR.CL";break;
case"221":$response="CIT-CAM.MOVISTAR.CL";break;
case"223":$response="AFEX.MOVISTAR.CL";break;
case"225":$response="COPEFRUT.MOVISTAR.CL";break;
case"226":$response="DYS.MOVISTAR.CL";break;
case"227":$response="CTORO.MOVISTAR.CL";break;
case"228":$response="TEST3.QIN.CL";break;
case"229":$response="WISETRACK.MOVISTAR.CL";break;
case"230":$response="SDVF1.MOVISTAR.CL";break;
case"231":$response="SERNATUR.MOVISTAR.CL";break;
case"232":$response="CRUZBLANCA.MOVISTAR.CL";break;
case"233":$response="PRAXAIR3G.MOVISTAR.CL";break;
case"234":$response="SITRACK.MOVISTAR.CL";break;
case"235":$response="MCOMPRA.MOVISTAR.CL";break;
case"236":$response="TEKNOS.MOVISTAR.CL";break;
case"237":$response="PDELREC.MOVISTAR.CL";break;
case"238":$response="REDFACIL.MOVISTAR.CL";break;
case"239":$response="INJURED.MOVISTAR.CL";break;
case"240":$response="PATSA.MOVISTAR.CL";break;
case"241":$response="ACTIVA.MOVISTAR.CL";break;
case"242":$response="PROGESTION.MOVISTAR.CL";break;
case"243":$response="INJUR.MOVISTAR.CL";break;
case"244":$response="EMBONOR3.MOVISTAR.CL";break;
case"245":$response="DANONECL.MOVISTAR.CL";break;
case"246":$response="DIMERC.MOVISTAR.CL";break;
case"247":$response="SYNAPSISFIJA.MOVISTAR.CL";break;
case"248":$response="LOJACK.MOVISTAR.CL";break;
case"249":$response="METROGAS.MOVISTAR.CL";break;
case"250":$response="ALFAL.MOVISTAR.CL";break;
case"251":$response="TRANSTEL.MOVISTAR.CL";break;
case"252":$response="CORDERO.MOVISTAR.CL";break;
case"253":$response="VIGATEC.MOVISTAR.CL";break;
case"254":$response="SEPMINEDUC.MOVISTAR.CL";break;
case"255":$response="SUBVMINEDUC.MOVISTAR.CL";break;
case"256":$response="TRACK.MOVISTAR.CL";break;
case"257":$response="TELEMETRICA.MOVISTAR.CL";break;
case"258":$response="DEPETRIS.MOVISTAR.CL";break;
case"259":$response="PROVIDA.MOVISTAR.CL";break;
case"260":$response="CTI.MOVISTAR.CL";break;
case"261":$response="TRANSELEC.MOVISTAR.CL";break;
case"262":$response="GETNET.MOVISTAR.CL";break;
case"263":$response="ALVI.MOVISTAR.CL";break;
case"264":$response="FASA.MOVISTAR.CL";break;
case"265":$response="LOSHEROES.MOVISTAR.CL";break;
case"266":$response="CENCOSUD.MOVISTAR.CL";break;
case"268":$response="FIRST.MOVISTAR.CL";break;
case"269":$response="RIPLEY3G.MOVISTAR.CL";break;
case"270":$response="MAISASA.MOVISTAR.CL";break;
case"271":$response="GPSTRACE.MOVISTAR.CL";break;
case"272":$response="ADT.MOVISTAR.CL";break;
case"273":$response="ORIENCOOP.MOVISTAR.CL";break;
case"274":$response="MFPRUEBAS.MOVISTAR.CL";break;
case"275":$response="ELECTROANDINA.MOVISTAR.CL";break;
case"276":$response="ARAMARK.MOVISTAR.CL";break;
case"277":$response="WAYPOINT.MOVISTAR.CL";break;
case"278":$response="MASVIDA.MOVISTAR.CL";break;
case"279":$response="DIFARMA.MOVISTAR.CL";break;
case"280":$response="SINACH.MOVISTAR.CL";break;
case"281":$response="POSITION.MOVISTAR.CL";break;
case"282":$response="AQUACHILE.MOVISTAR.CL";break;
case"283":$response="EMBONOR2.MOVISTAR.CL";break;
case"284":$response="RAPTOR.MOVISTAR.CL";break;
case"285":$response="ATENTO.MOVISTAR.CL";break;
case"286":$response="AUTOMA.MOVISTAR.CL";break;
case"287":$response="LAPOLAR.MOVISTAR.CL";break;
case"288":$response="FALABELLA.MOVISTAR.CL";break;
case"289":$response="ESSBIO.MOVISTAR.CL";break;
case"290":$response="CONSTP.MOVISTAR.CL";break;
case"291":$response="PRECISION.MOVISTAR.CL";break;
case"292":$response="MRECARGAS.MOVISTAR.CL";break;
case"293":$response="PROSEGUR2.MOVISTAR.CL";break;
case"294":$response="LOSHEROESFIJA.MOVISTAR.CL";break;
case"295":$response="AUTER.MOVISTAR.CL";break;
case"296":$response="SANDE.MOVISTAR.CL";break;
case"297":$response="CENCOSUDBAM.MOVISTAR.CL";break;
case"298":$response="WSP.MOVISTAR.CL";break;
case"299":$response="FACTOTAL.MOVISTAR.CL";break;
case"300":$response="BANMEDICA.MOVISTAR.CL";break;
case"301":$response="CONSALUD.MOVISTAR.CL";break;
case"302":$response="SIGES.MOVISTAR.CL";break;
case"303":$response="RELACOM.MOVISTAR.CL";break;
case"304":$response="FEROUCH.MOVISTAR.CL";break;
case"305":$response="ENERSIS.MOVISTAR.CL";break;
case"306":$response="TRICOLOR.MOVISTAR.CL";break;
case"307":$response="MODINGER.MOVISTAR.CL";break;
case"308":$response="EFT.MOVISTAR.CL";break;
case"309":$response="KNOP.MOVISTAR.CL";break;
case"310":$response="USS.MOVISTAR.CL";break;
case"311":$response="COPEVAL.MOVISTAR.CL";break;
case"312":$response="TEST-GY.TMOVIL.CL";break;
case"313":$response="PEPSICO.MOVISTAR.CL";break;
case"314":$response="MULTICENTRO.MOVISTAR.CL";break;
case"315":$response="LARRAINVIAL.MOVISTAR.CL";break;
case"316":$response="SPRINGWIRELESS.MOVISTAR.CL";break;
case"317":$response="MEGACOMPRA.MOVISTAR.CL";break;
case"318":$response="CBB.MOVISTAR.CL";break;
case"319":$response="CORRUPAC.MOVISTAR.CL";break;
case"320":$response="HP-SHELL.MOVISTAR.CL";break;
case"321":$response="MOVILWAY.MOVISTAR.CL";break;
case"322":$response="ENDESACHILE.MOVISTAR.CL";break;
case"323":$response="SERVINCO.MOVISTAR.CL";break;
case"324":$response="CONSALUD2.MOVISTAR.CL";break;
case"325":$response="CCLOSANDES.MOVISTAR.CL";break;
case"326":$response="PRESIDENCIA.MOVISTAR.CL";break;
case"327":$response="LOCALIZAME.MOVISTAR.CL";break;
case"328":$response="CVECINABE.MOVISTAR.CL";break;
case"329":$response="FASTFOOD.MOVISTAR.CL";break;
case"330":$response="MTCJ2.MOVISTAR.CL";break;
case"331":$response="POLPAICO.MOVISTAR.CL";break;
case"332":$response="ENAP.MOVISTAR.CL";break;
case"333":$response="PALUMBO.MOVISTAR.CL";break;
case"334":$response="TECPLANET.MOVISTAR.CL";break;
case"335":$response="TRACE.MOVISTAR.CL";break;
case"336":$response="AGUNSA.MOVISTAR.CL";break;
case"337":$response="CHILENA.MOVISTAR.CL";break;
case"338":$response="METROCYC.MOVISTAR.CL";break;
case"339":$response="PRUEBA8.MOVISTAR.CL";break;
case"340":$response="TEST.DIRECTO.CL";break;
case"341":$response="MAPFRE.MOVISTAR.CL";break;
case"342":$response="ADT2.MOVISTAR.CL";break;
case"343":$response="BIMBITA.MOVISTAR.CL";break;
case"344":$response="GENER.MOVISTAR.CL";break;
case"345":$response="REDBANC2.MOVISTAR.CL";break;
case"346":$response="GPSTECNOLOGICA.MOVISTAR.CL";break;
case"347":$response="SOCOEPA.MOVISTAR.CL";break;
case"348":$response="CHILLANSKY.MOVISTAR.CL";break;
case"349":$response="MOVISTARGPS.MOVISTAR.CL";break;
case"350":$response="GPS7000.MOVISTAR.CL";break;
case"351":$response="AFEX2.MOVISTAR.CL";break;
case"352":$response="CVX-R.MOVISTAR.CL";break;
case"353":$response="TRUSAL.MOVISTAR.CL";break;
case"354":$response="ORIENCOOP2.MOVISTAR.CL";break;
case"355":$response="MOVILWAY2.MOVISTAR.CL";break;
case"356":$response="DBDORION.MOVISTAR.CL";break;
case"357":$response="CAJA18.MOVISTAR.CL";break;
case"358":$response="NETMARKETSPA.MOVISTAR.CL";break;
case"359":$response="TECNOCRUX.MOVISTAR.CL";break;
case"360":$response="SECURITY.MOVISTAR.CL";break;
case"361":$response="REDORSAN.MOVISTAR.CL";break;
case"362":$response="ADT-TABLET.MOVISTAR.CL";break;
case"363":$response="CAM.MOVISTAR.CL";break;
case"364":$response="IW.MOVISTAR.CL";break;
case"365":$response="SMA.MOVISTAR.CL";break;
case"366":$response="UCM.MOVISTAR.CL";break;
case"367":$response="PROACTIVA.MOVISTAR.CL";break;
case"368":$response="FORLI.MOVISTAR.CL";break;
case"369":$response="BRINKS.MOVISTAR.CL";break;
case"370":$response="FEDERAL.MOVISTAR.CL";break;
case"371":$response="LVGE.MOVISTAR.CL";break;
case"372":$response="MELON.MOVISTAR.CL";break;
case"373":$response="PJUD.MOVISTAR.CL";break;
case"374":$response="TSENSOR.MOVISTAR.CL";break;
case"375":$response="PF.MOVISTAR.CL";break;
case"376":$response="TESTFIX.MOVISTAR.CL";break;
case"377":$response="E12.MOVISTAR.CL";break;
case"378":$response="JANSSEN.MOVISTAR.CL";break;
case"379":$response="EON2.MOVISTAR.CL";break;
case"380":$response="METLIFE.MOVISTAR.CL";break;
case"381":$response="LOGROS.MOVISTAR.CL";break;
case"382":$response="COASIN.MOVISTAR.CL";break;
case"383":$response="BLUMAR.MOVISTAR.CL";break;
case"384":$response="QIWI.MOVISTAR.CL";break;
case"385":$response="LAELEGANTE.MOVISTAR.CL";break;
case"386":$response="SAAM.MOVISTAR.CL";break;
case"387":$response="AIRLIQUIDE.MOVISTAR.CL";break;
case"388":$response="SUBUS.MOVISTAR.CL";break;
case"389":$response="BICE.MOVISTAR.CL";break;
case"390":$response="TMMOVIL.MOVISTAR.CL";break;
case"391":$response="AGROSIST.MOVISTAR.CL";break;
case"392":$response="TEST-VOLTE.MOVISTAR.CL";break;
case"393":$response="MININT8.MOVISTAR.CL";break;
case"394":$response="BALFOUR.MOVISTAR.CL";break;
case"395":$response="INDUCOM.MOVISTAR.CL";break;
case"396":$response="SICE.MOVISTAR.CL";break;
case"397":$response="OWLCHILE.MOVISTAR.CL";break;
case"398":$response="AAANAM.MOVISTAR.CL";break;
case"399":$response="AANDINAS.MOVISTAR.CL";break;
case"400":$response="AAECORILES.MOVISTAR.CL";break;
case"401":$response="SURA.MOVISTAR.CL";break;
case"402":$response="TRANSNET.MOVISTAR.CL";break;
case"403":$response="NEOPAG.MOVISTAR.CL";break;
case"404":$response="FERROVIAL.MOVISTAR.CL";break;
case"405":$response="BERMANN.MOVISTAR.CL";break;
case"406":$response="COPELEC.MOVISTAR.CL";break;
case"407":$response="PAT.MOVISTAR.CL";break;
case"408":$response="BISSEN.MOVISTAR.CL";break;
case"409":$response="HORTIFRUT.MOVISTAR.CL";break;
case"410":$response="MH.MOVISTAR.CL";break;
case"411":$response="TELEID.MOVISTAR.CL";break;
case"412":$response="CHILECTRA.MOVISTAR.CL";break;
case"413":$response="HUAWEI.DNS.NAPTR.CL";break;
case"414":$response="IST.MOVISTAR.CL";break;
case"415":$response="BSP.MOVISTAR.CL";break;
case"416":$response="LOREALSR.MOVISTAR.CL";break;
case"417":$response="COOLDATA.MOVISTAR.CL";break;
case"418":$response="PULLMAN.MOVISTAR.CL";break;
case"419":$response="JJD.MOVISTAR.CL";break;
case"420":$response="SKYSAT.MOVISTAR.CL";break;
case"421":$response="MGIPSEC.MOVISTAR.CL";break;
case"422":$response="ENORCHILE.MOVISTAR.CL";break;
case"600":$response="MVNETEST.CL";break;
case"601":$response="WISETRACK2.MOVISTAR.CL";break;
case"602":$response="TECNETMPLS.MOVISTAR.CL";break;
case"603":$response="CLOSANDES.MOVISTAR.CL";break;
case"604":$response="RBCAJEROS.MOVISTAR.CL";break;
case"800":$response="CALDERON.MOVISTAR.CL";break;
case"867":$response="MIST.MOVISTAR.CL";break;
case"868":$response="TEST7.MOVISTAR.CL";break;
case"872":$response="PRUEBA11.MOVISTAR.CL";break;
case"888":$response="PRUEBA7.MOVISTAR.CL";break;
case"901":$response="HUAWEI.MOVISTAR.CL";break;
case"902":$response="MAQUETA.MOVISTAR.CL";break;
case"903":$response="DAS2.MOVISTAR.CL";break;
case"904":$response="TEST-WEB.TMOVIL.CL";break;
case"905":$response="TEST-WAP.TMOVIL.CL";break;
case"906":$response="TEST-MMS.TMOVIL.CL";break;
case"907":$response="TEST-IPV6.TMOVIL.CL";break;
case"908":$response="TEST-GG.TMOVIL.CL";break;
case"910":$response="TEST9.MOVISTAR.CL";break;
case"911":$response="TEST-SMT.TMOVIL.CL";break;
case"912":$response="TEST-SMT-WEB.TMOVIL.CL";break;
case"913":$response="TEST-SMT-MOBI.TMOVIL.CL";break;
case"914":$response="GY-TEST.NETLINE.CL";break;
case"915":$response="TESTM2M.MOVISTAR.CL";break;
case"950":$response="MAQUETASMT";break;
case"955":$response="SERVIPAGTEST.MOVISTAR.CL";break;
case"987":$response="TEST-LTE.MOVISTAR.CL";break;
case"988":$response="TESTQIN2.MOVISTAR.CL";break;
case"999":$response="TEST.QIN.CL";break;
case"1000":$response="HUAWEI.TMOVIL.CL";break;
case"1010":$response="TEST-BAM.MOVISTAR.CL";break;
case"1500":$response="MVNE.PIVOTE.CL";break;
case"5001":$response="WEB.GTDMOVIL.CL";break;
case"5002":$response="WAP.GTDMOVIL.CL";break;
case"5003":$response="MMS.GTDMOVIL.CL";break;
case"5004":$response="BLACKBERRY.GTDMOVIL.CL";break;
case"5010":$response="BAM.VIRGINMOBILE.CL";break;
case"5011":$response="IMOVIL.VIRGINMOBILE.CL";break;
case"5012":$response="MMSC.VIRGINMOBILE.CL";break;
default:$response= $APNID;break;			

		}
		return $response;
	}
	
	/**
	 * Translate_QOSTPLID Array for Human reading
	 *
	 * Following syntax are recognized :
	 *
	 * @param string $array Original
	 * @return string
	 */
	function Translate_QOSTPLID($QOSTPLID){
		switch($QOSTPLID){
case "1":$response = "8000-16000 kbps";break;
case "2":$response = "512-512 kbps";break;
case "3":$response = "128-256 kbps";break;
case "4":$response = "32-64 kbps";break;
case "11":$response = "16-32 kbps";break;
case "201":$response = "8-16 kbps";break;
case "0":$response = "8-8 kbps";break;
case "5":$response = "4352-4352 kbps";break;
case "6":$response = "128-256 kbps";break;
case "7":$response = "64-64 kbps";break;
case "8":$response = "64-128 kbps";break;
case "9":$response = "64-200 kbps";break;
case "10":$response = "64-400 kbps";break;
case "14":$response = "8000-16000 kbps";break;
case "15":$response = "8000-16000 kbps";break;
case "16":$response = "160-384 kbps";break;
case "17":$response = "64-64 kbps";break;
case "18":$response = "64-128 kbps";break;
case "19":$response = "64-200 kbps";break;
case "20":$response = "64-400 kbps";break;
case "21":$response = "64-32 kbps";break;
case "22":$response = "32-16 kbps";break;
case "23":$response = "4096-8000 kbps";break;
case "25":$response = "8000-42000 kbps";break;
case "35":$response = "8064-16000 kbps";break;
case "36":$response = "136-256 kbps";break;
case "37":$response = "4096-4160 kbps";break;
case "38":$response = "72-128 kbps";break;
case "40":$response = "3712-3712 kbps";break;
case "41":$response = "5056-5056 kbps";break;
case "42":$response = "7168-7168 kbps";break;
case "50":$response = "4224-4224 kbps";break;
case "51":$response = "4224-4224 kbps";break;
case "52":$response = "5504-5504 kbps";break;
case "53":$response = "4160-4160 kbps";break;
case "60":$response = "5504-5504 kbps";break;
case "66":$response = "8000-20000 kbps";break;
case "67":$response = "8000-22000 kbps";break;
case "70":$response = "144-272 kbps";break;
case "71":$response = "4352-4352 kbps";break;
case "73":$response = "160-384 kbps";break;
case "80":$response = "512-8000 kbps";break;
case "81":$response = "512-6000 kbps";break;
case "82":$response = "512-4000 kbps";break;
case "83":$response = "512-2000 kbps";break;
case "300":$response = "3648-12000 kbps";break;
case "305":$response = "3584-3584 kbps";break;
default:$response= $QOSTPLID;break;
		}
		return $response;
	}
	
	/**
	 * Translate_EPS_QOSTPLID Array for Human reading
	 *
	 * Following syntax are recognized :
	 *
	 * @param string $array Original
	 * @return string
	 */
	function Translate_EPS_QOSTPLID($EPS_QOSTPLID){
		switch($EPS_QOSTPLID){
			case "1":
				$response	= "100000000 - 100000000 kb";
			break;
			case "2":
				$response	= "512-512 kb";
			break;
			case "3":
				$response	= "128-256 kb";
			break;
			case "4":
				$response	= "32-64 kb";
			break;
		}
		return $response;
	}
}
?>
